package com.eeepay.eeepay_v2.adapter;

import android.content.Context;
import android.util.Log;

import com.eeepay.eeepay_v2.R;
import com.eeepay.v2_library.adapter.ABBaseAdapter;
import com.eeepay.v2_library.adapter.ABViewHolder;

import cn.eeepay.api.grpc.nano.MerAddModular;

/**
 * Created by Ching on 2016/7/21.
 */
public class PaperQueryAdapter extends ABBaseAdapter<MerAddModular.MerRequireItem> {

    public PaperQueryAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_papers_girdview;
    }

    @Override
    public void convert(ABViewHolder holder, MerAddModular.MerRequireItem model) {
        String itemName = null;
        int itemImage = 0;
        switch (model.mriId) {
            case "8"://手持身份证
                itemName = mContext.getResources().getString(R.string.scsfz);
                itemImage = R.drawable.scsfz;
                break;
            case "9"://身份证正面
                itemName = mContext.getResources().getString(R.string.sfzzm);
                itemImage = R.drawable.sfzzm;
                break;
            case "10"://身份证反面
                itemName = mContext.getResources().getString(R.string.sfzfm);
                itemImage = R.drawable.sfzfm;
                break;
            case "11"://银行卡正面
                itemName = mContext.getResources().getString(R.string.yhkzm);
                itemImage = R.drawable.yhkzm;
                break;
            case "12"://营业执照
                itemName = mContext.getResources().getString(R.string.yyzz);
                itemImage = R.drawable.yyzz;
                break;
            case "16"://活体照片
                itemName = mContext.getResources().getString(R.string.htzp);
                itemImage = R.drawable.htyz;
        }
        if ("2".equals(model.status)) {//标红审核失败进件项
            holder.setTextColor(R.id.tv_fileName, mContext.getResources().getColor(R.color.red));
        }
        holder.setText(R.id.tv_fileName, itemName);
        holder.setImageByUrl(R.id.iv_demand, model.content);
    }
}
